function [out]=Payoff_Conservation_EFvalue_STATIC1(x)

global theta  numpatches Dii   domain_suit_hab max_age age_mature...
    age_legal  Wij Rmax alpha1 delta Kvirgin  pr max_simulation_length ...
       Fsum  hide0_show1_figures K Bi_legal_fish  beta_i_initial ...
       Bij_initial TargetBiomass CRgoal theta_percent FleetProfit_Fsum_opt...
       Payoff_Conservation_EF_alpha_STATIC1 x0_Fsumguess LB UB MPA_locs_STATIC1 Fsum_UB_prop_wrt_sumFishingHab...
       Bi_initial Bi_Fsum_opt Profit_i_Fsumopt_NoMPAs...
       NCI_MPA_locs...
       Kunfished_hat discounted_value_iy discounted_value_ijy

% Payoff_Conservation_EF_alpha_STATIC1=0.1; %comment out if running in loop



% (input from Heuristic)
% MPA_locs_STATIC1=x; %locs that are fished (0) or MPAs (1) - does not account for existing NCI MPAs
%below accounts for NCI MPAs
tmp=NCI_MPA_locs'; %set vector just with NCI MPAs TRANSPOSE?
tmp(NCI_MPA_locs==0)=x; %fill itn the new MPAs by heuristic
MPA_locs_STATIC1=tmp;

% whos Bi_initial MPA_locs_STATIC1

% Bi_mpas=sum(Bi_initial.*MPA_locs_STATIC1); %biomass in the MPAS (=virgin biomass in those patches) - But, static manager does not  know this!
Bi_mpas=sum(Kunfished_hat.*MPA_locs_STATIC1); %estimate of biomass in patches if they were closed, based on NCI MPA regression at opt Fsum
Bi_fished=sum(Bi_Fsum_opt.*(MPA_locs_STATIC1==0)); %biomass in fished patches (=biomass in those patches given optimal Fsum and no MPAs)
out_Biomass=Bi_mpas+Bi_fished;
minpossible_out_Biomass=sum(Bi_Fsum_opt); %min biomass possible = biomass if all patches fished
%scaled so will range 0-1 wrt to minpossible_out_Biomass(no mpas)-Kvirgin(100% mpas)
% conservation_scaled=(out_Biomass-minpossible_out_Biomass)/(Kvirgin-minpossible_out_Biomass); %No, manageer does not know Kvirgin
conservation_scaled=(out_Biomass-minpossible_out_Biomass)/(sum(Kunfished_hat)-minpossible_out_Biomass); %scale wrt to Kunfished_hat

out_Payoff=sum(Profit_i_Fsumopt_NoMPAs.*(MPA_locs_STATIC1==0)); %payoff (=profit in fished patches=profit in those patches given optimal Fsum and no MPAs)
payoff_scaled=out_Payoff/FleetProfit_Fsum_opt;


out_display=-sum(Payoff_Conservation_EF_alpha_STATIC1*payoff_scaled + (1-Payoff_Conservation_EF_alpha_STATIC1)*conservation_scaled);
% disp(['Payoff_Conservation_EF_alpha_STATIC1=',num2str(Payoff_Conservation_EF_alpha_STATIC1),'; out (goal is NEG ONE)=',num2str(out_display),]);
out=out_display;



